<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org" xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect" layout:decorate="~{layout}">
<head>
	<title>Weclome</title>
</head>
<body>
	<div layout:fragment="content">
		<form class="form-inline" name="f" th:action="@{/setValue}" method="post">
			<fieldset>
				<legend>Add value to session</legend>
				<input type="text" id="key" name="key" placeholder="key"/>
				<input type="text" id="value" name="value" placeholder="value"/>
				<button type="submit" class="btn btn-primary">Save</button>
			</fieldset>
		</form>
	</div>
	<div layout:fragment="table-content">
		<table class="table table-bordered" style="table-layout: fixed; word-wrap: break-word;">
			<thead>
				<tr>
					<th>Attribute Name</th>
					<th>Attribute Value</th>
				</tr>
			</thead>
			<tbody>
				<tr th:each="name : ${T(java.util.Collections).list(#httpSession.getAttributeNames())}">
					<td th:text="${name}"></td>
					<td th:text="${#httpSession.getAttribute(name)}"></td>
				</tr>
			</tbody>
		</table>
	</div>
</body>
</html>
